package chapter5.Example25;

import java.time.Duration;
import java.time.LocalTime;

public class example25 {
    public static void main(String[] args) {
        LocalTime start = LocalTime.now();
        LocalTime end = LocalTime.of(2018,12,12);
        Duration duration = Duration.between(start,end);
        System.out.println("时间间隔为："+duration.toNanos()+"年");
        System.out.println("时间间隔为："+duration.toMillis()+"月");
        System.out.println("时间间隔为："+duration.toHours()+"天");
    }
}

